import math

rightInput = False
while not(rightInput):
    dataList = input("请输入三角形的两边长及其夹角(角度制)，用(, )隔开\n").split(',')
    if len(dataList) != 3:
        print("输入错误")
        continue
    try:
        for index in range(3):
            dataList[index] = float(dataList[index])
        rightInput = True
    except:
        print("输入错误")

[a, b, angle] = dataList
angle = angle * math.pi / 180  #角度转弧度
c = math.sqrt(a**2 + b**2 - 2 * a * b * math.cos(angle))  #余弦定理

print('{:.4f}'.format(c))
input("Press any key to continue")